package pl.edu.amu.wmi.kino.visualjavafx.model.objects;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import pl.edu.amu.wmi.kino.visualjavafx.model.animation.transformations.Translatable;

// <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
// #[regen=yes,id=DCE.FEA49E42-94E0-EAE3-AE7D-873C262E0556]
// </editor-fold> 
public class Point implements Translatable ,java.io.Serializable{

    // Code block for changeListeners support start
    protected PropertyChangeSupport propertySupport= new PropertyChangeSupport(this);
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.addPropertyChangeListener(listener);
    }
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.removePropertyChangeListener(listener);
    }
    // Code block for changeListeners support end

    private double x = 0;
    private double y = 0;

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.0F0EA3B9-B3E0-F08C-BFC4-DAACC23E41F8]
    // </editor-fold> 
    public Point () {
    }

    public Point(double v, double h){
        this.setHPos(h);
        this.setVPos(v);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.503B08B1-444C-EADA-5D87-DAF0920C55FB]
    // </editor-fold> 
    @Override
    public double getHPos () {
        return y;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.86CAB449-DCE2-713A-0FBA-BE5DE438DB4C]
    // </editor-fold> 
    @Override
    public void setHPos (double val) {
        double oldVal = this.y;
        this.y=val;
        propertySupport.firePropertyChange( "HPos" , oldVal, val);
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.80B6A65B-F940-E181-5EAB-CC4DEB9ADD18]
    // </editor-fold> 
    @Override
    public double getVPos () {
        return x;
    }

    // <editor-fold defaultstate="collapsed" desc=" UML Marker "> 
    // #[regen=yes,id=DCE.29D7C751-69A4-8526-3E06-18DBD3FB643C]
    // </editor-fold> 
    @Override
    public void setVPos (double val) {
        double oldVal = this.x;
        this.x=val;
        propertySupport.firePropertyChange( "VPos" , oldVal, val);
    }

    @Override
    public Point clone(){
        Point res = new Point();
        res.x=this.x;
        res.y=this.y;
        return res;
    }

}

